← Back
Editing: index-legacy467.js
!function(){function t(e){return t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},t(e)}function e(t){return function(t){if(Array.isArray(t))return n(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(t){if("string"==typeof t)return n(t,e);var r={}.toString.call(t).slice(8,-1);return"Object"===r&&t.constructor&&(r=t.constructor.name),"Map"===r||"Set"===r?Array.from(t):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?n(t,e):void 0}}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function n(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=Array(e);n<e;n++)r[n]=t[n];return r}function r(){"use strict";/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */r=function(){return n};var e,n={},o=Object.prototype,i=o.hasOwnProperty,a=Object.defineProperty||function(t,e,n){t[e]=n.value},l="function"==typeof Symbol?Symbol:{},u=l.iterator||"@@iterator",c=l.asyncIterator||"@@asyncIterator",s=l.toStringTag||"@@toStringTag";function f(t,e,n){return Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{f({},"")}catch(e){f=function(t,e,n){return t[e]=n}}function d(t,e,n,r){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),l=new P(r||[]);return a(i,"_invoke",{value:S(t,n,l)}),i}function p(t,e,n){try{return{type:"normal",arg:t.call(e,n)}}catch(t){return{type:"throw",arg:t}}}n.wrap=d;var m="suspendedStart",v="suspendedYield",h="executing",y="completed",g={};function w(){}function b(){}function x(){}var _={};f(_,u,(function(){return this}));var k=Object.getPrototypeOf,E=k&&k(k(N([])));E&&E!==o&&i.call(E,u)&&(_=E);var L=x.prototype=w.prototype=Object.create(_);function j(t){["next","throw","return"].forEach((function(e){f(t,e,(function(t){return this._invoke(e,t)}))}))}function C(e,n){function r(o,a,l,u){var c=p(e[o],e,a);if("throw"!==c.type){var s=c.arg,f=s.value;return f&&"object"==t(f)&&i.call(f,"__await")?n.resolve(f.__await).then((function(t){r("next",t,l,u)}),(function(t){r("throw",t,l,u)})):n.resolve(f).then((function(t){s.value=t,l(s)}),(function(t){return r("throw",t,l,u)}))}u(c.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new n((function(n,o){r(t,e,n,o)}))}return o=o?o.then(i,i):i()}})}function S(t,n,r){var o=m;return function(i,a){if(o===h)throw Error("Generator is already running");if(o===y){if("throw"===i)throw a;return{value:e,done:!0}}for(r.method=i,r.arg=a;;){var l=r.delegate;if(l){var u=V(l,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===m)throw o=y,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=h;var c=p(t,n,r);if("normal"===c.type){if(o=r.done?y:v,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=y,r.method="throw",r.arg=c.arg)}}}function V(t,n){var r=n.method,o=t.iterator[r];if(o===e)return n.delegate=null,"throw"===r&&t.iterator.return&&(n.method="return",n.arg=e,V(t,n),"throw"===n.method)||"return"!==r&&(n.method="throw",n.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=p(o,t.iterator,n.arg);if("throw"===i.type)return n.method="throw",n.arg=i.arg,n.delegate=null,g;var a=i.arg;return a?a.done?(n[t.resultName]=a.value,n.next=t.nextLoc,"return"!==n.method&&(n.method="next",n.arg=e),n.delegate=null,g):a:(n.method="throw",n.arg=new TypeError("iterator result is not an object"),n.delegate=null,g)}function O(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function A(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function P(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(O,this),this.reset(!0)}function N(n){if(n||""===n){var r=n[u];if(r)return r.call(n);if("function"==typeof n.next)return n;if(!isNaN(n.length)){var o=-1,a=function t(){for(;++o<n.length;)if(i.call(n,o))return t.value=n[o],t.done=!1,t;return t.value=e,t.done=!0,t};return a.next=a}}throw new TypeError(t(n)+" is not iterable")}return b.prototype=x,a(L,"constructor",{value:x,configurable:!0}),a(x,"constructor",{value:b,configurable:!0}),b.displayName=f(x,s,"GeneratorFunction"),n.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===b||"GeneratorFunction"===(e.displayName||e.name))},n.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,x):(t.__proto__=x,f(t,s,"GeneratorFunction")),t.prototype=Object.create(L),t},n.awrap=function(t){return{__await:t}},j(C.prototype),f(C.prototype,c,(function(){return this})),n.AsyncIterator=C,n.async=function(t,e,r,o,i){void 0===i&&(i=Promise);var a=new C(d(t,e,r,o),i);return n.isGeneratorFunction(e)?a:a.next().then((function(t){return t.done?t.value:a.next()}))},j(L),f(L,s,"Generator"),f(L,u,(function(){return this})),f(L,"toString",(function(){return"[object Generator]"})),n.keys=function(t){var e=Object(t),n=[];for(var r in e)n.push(r);return n.reverse(),function t(){for(;n.length;){var r=n.pop();if(r in e)return t.value=r,t.done=!1,t}return t.done=!0,t}},n.values=N,P.prototype={constructor:P,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=e,this.done=!1,this.delegate=null,this.method="next",this.arg=e,this.tryEntries.forEach(A),!t)for(var n in this)"t"===n.charAt(0)&&i.call(this,n)&&!isNaN(+n.slice(1))&&(this[n]=e)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var n=this;function r(r,o){return l.type="throw",l.arg=t,n.next=r,o&&(n.method="next",n.arg=e),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var a=this.tryEntries[o],l=a.completion;if("root"===a.tryLoc)return r("end");if(a.tryLoc<=this.prev){var u=i.call(a,"catchLoc"),c=i.call(a,"finallyLoc");if(u&&c){if(this.prev<a.catchLoc)return r(a.catchLoc,!0);if(this.prev<a.finallyLoc)return r(a.finallyLoc)}else if(u){if(this.prev<a.catchLoc)return r(a.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<a.finallyLoc)return r(a.finallyLoc)}}}},abrupt:function(t,e){for(var n=this.tryEntries.length-1;n>=0;--n){var r=this.tryEntries[n];if(r.tryLoc<=this.prev&&i.call(r,"finallyLoc")&&this.prev<r.finallyLoc){var o=r;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=t,a.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(a)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.finallyLoc===t)return this.complete(n.completion,n.afterLoc),A(n),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var n=this.tryEntries[e];if(n.tryLoc===t){var r=n.completion;if("throw"===r.type){var o=r.arg;A(n)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,n,r){return this.delegate={iterator:N(t),resultName:n,nextLoc:r},"next"===this.method&&(this.arg=e),g}},n}function o(t,e,n,r,o,i,a){try{var l=t[i](a),u=l.value}catch(t){return void n(t)}l.done?e(u):Promise.resolve(u).then(r,o)}function i(t){return function(){var e=this,n=arguments;return new Promise((function(r,i){var a=t.apply(e,n);function l(t){o(a,r,i,l,u,"next",t)}function u(t){o(a,r,i,l,u,"throw",t)}l(void 0)}))}}System.register(["./index-legacy109.js?v=1765440387","./utils-lib-legacy.js?v=1765440387","./base-lib-legacy.js?v=1765440387","./column-legacy.js?v=1765440387","./site-legacy.js?v=1765440387","./useStore-legacy3.js?v=1765440387","./__commonjsHelpers__-legacy.js?v=1765440387","./index-legacy95.js?v=1765440387"],(function(t,n){"use strict";var o,a,l,u,c,s,f,d,p,m,v,h,y,g,w,b,x,_,k,E,L,j,C,S,V,O,A,P,N,q,G,I,F,U,T,B,H,M,z,J,K,R,Y;return{setters:[function(t){o=t._},function(t){a=t.K,l=t.b,u=t.q,c=t.W,s=t.l,f=t.ag,d=t.k,p=t.A,m=t._},function(t){v=t.r,h=t.k,y=t.c,g=t.p,w=t.G,b=t.H,x=t.x,_=t.q,k=t.v,E=t.e,L=t.A,j=t.B,C=t.y,S=t.F,V=t.b0,O=t.Q,A=t.J,P=t.z,N=t.I,q=t.P,G=t.D,I=t.a9,F=t.a7,U=t.C,T=t.M},function(t){B=t.B},function(t){H=t.fK,M=t.fL,z=t.fM,J=t.fN,K=t.fO,R=t.fP},function(t){Y=t.u},null,null],execute:function(){var n=l(),D=Y().siteInfo,Q=v([]),W=v(!1),$=v(),X=v(!1),Z=h({name:"",command:"",sid:"",level:11,log_type:"append",isEdit:!1}),tt=v(!1),et=v(!1),nt=v([{label:"追加记录",value:"append"},{label:"启动时清空",value:"cover"}]),rt=v(!1),ot=h({logContent:"",logLoading:!1,title:"",sid:""}),it=h({name:[{required:!0,message:"请输入服务名称",trigger:"blur"}],command:[{required:!0,message:"请输入启动命令",trigger:"blur"}],level:[{required:!0,message:"请输入优先级",trigger:"blur"}]}),at=v([{content:"协同服务用于管理那些与web服务同时运行的,用于处理一些事务的服务,如:任务队列、定时队列等,例如:celery等。"},{content:"当前工作方式为启动项目时检测这些服务,若未启动则执行启动,若已启动则不进行操作;停止项目时执行所有服务的停止操作"}]),lt=function(t){Z.log_type=t},ut=function(){ht(),W.value=!0},ct=function(t){Z.name=t.name,Z.command=t.command,Z.sid=t.sid,Z.level=t.level,Z.log_type=t.log_type,Z.isEdit=!0,W.value=!0},st=function(){var t=i(r().mark((function t(e){var o,i;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,!e&&(ot.logLoading=!0),t.next=4,H({project_name:D.value.name,sid:ot.sid});case 4:o=t.sent,i=o.data,ot.logContent=i.data,ot.logLoading=!1,e&&n.success("刷新成功"),t.next=13;break;case 11:t.prev=11,t.t0=t.catch(0);case 13:case"end":return t.stop()}}),t,null,[[0,11]])})));return function(e){return t.apply(this,arguments)}}(),ft=function(t){ot.sid=t.sid,ot.title="main"===t.sid?"项目主服务":t.name,rt.value=!0,st(!1)},dt=function(){var t=i(r().mark((function t(e){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,u({icon:"warning-filled",title:"删除服务【".concat(e.name,"】"),content:"删除服务【".concat(e.name,"】后,将无法管理该服务,是否继续?")});case 2:return t.next=4,a({loading:"正在删除服务,请稍后...",request:K({project_name:D.value.name,sid:e.sid}),message:!0});case 4:t.sent.status&&yt();case 6:case"end":return t.stop()}}),t)})));return function(e){return t.apply(this,arguments)}}(),pt=function(){var t=i(r().mark((function t(e,n){return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,a({loading:"正在修改服务状态,请稍后...",request:R({project_name:D.value.name,sid:n.sid,option:e}),message:!0});case 2:t.sent.status&&yt();case 4:case"end":return t.stop()}}),t)})));return function(e,n){return t.apply(this,arguments)}}(),mt=function(){W.value=!1,ht()},vt=function(){var t=i(r().mark((function t(){var e,n;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,$.value.validate();case 2:return e={project_name:D.value.name,service_conf:JSON.stringify({name:Z.name,command:Z.command,level:Z.level,log_type:Z.log_type})},Z.isEdit&&(e.sid=Z.sid),n=Z.isEdit?M:z,t.next=7,a({loading:X,request:n(e),message:!0});case 7:t.sent.status&&(W.value=!1,ht(),yt());case 9:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),ht=function(){Z.name="",Z.command="",Z.sid="",Z.level=11,Z.log_type="append",Z.isEdit=!1},yt=function(){var t=i(r().mark((function t(){var e,n=arguments;return r().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return(e=n.length>0&&void 0!==n[0]&&n[0])&&(et.value=!0),t.next=4,a({request:J({project_name:D.value.name}),data:{data:[Array,Q]}});case 4:e&&(et.value=!1);case 5:case"end":return t.stop()}}),t)})));return function(){return t.apply(this,arguments)}}(),gt={class:"overflow-auto mt-1rem max-h-[61rem]"},wt={class:"flex flex-col p-[16px]"},bt={class:"service-info"},xt={class:"item-info"},_t={class:"flex items-center"},kt={class:"item-info"},Et={key:0},Lt={key:1},jt={key:0,class:"item-info"},Ct={class:"!w-[100%]"},St=["onClick"],Vt={class:"flex items-center mt-[16px]"},Ot={class:"p-2rem"},At={class:"ml-[1rem] text-[#20a53a] w-[16rem] select-none"},Pt={class:"py-[2rem] pt-[0]"},Nt={class:"p-2rem flex flex-col"},qt=y({__name:"index",setup:function(t){return g((function(){yt(!0)})),function(t,n){var r=G,i=c,a=s,l=I,u=f,m=F,v=d,h=o,y=w("bt-loading");return b((_(),k("div",null,[E(r,{type:"primary",onClick:x(ut)},{default:L((function(){return n[9]||(n[9]=[j("添加服务")])})),_:1},8,["onClick"]),C("div",gt,[(_(!0),k(S,null,V(x(Q),(function(t,o){return _(),k("div",{class:"border rounded-[2px] border-[#EBEEF5] mb-[16px]",key:o},[C("div",wt,[C("div",bt,[C("div",xt,[C("div",null,"服务:"+P(t.name),1),C("div",_t,[n[10]||(n[10]=j("状态:")),E(x(B),{modelValue:!!t.pid},null,8,["modelValue"])])]),C("div",kt,[t.pid?(_(),k("div",Et,"pid:"+P(t.pid),1)):U("v-if",!0),t.ports.length?(_(),k("div",Lt,"端口:"+P(t.ports.join(", ")),1)):U("v-if",!0)]),t.sid&&"main"!==t.sid?(_(),k("div",jt,[C("div",Ct,[j(" 启动命令:"+P(t.command)+" ",1),C("i",{class:"svgtofont-el-document-copy cursor-pointer text-[#333] text-[1.5rem] copy ml-[4px]",title:"复制启动命令",onClick:function(){return x(p)({value:t.command})}},null,8,St)])])):U("v-if",!0)]),C("div",Vt,[t.pid?(_(),T(r,{key:1,type:"default",onClick:function(e){return x(pt)("stop",t)}},{default:L((function(){return e(n[12]||(n[12]=[j("停止")]))})),_:2},1032,["onClick"])):(_(),T(r,{key:0,type:"default",onClick:function(e){return x(pt)("start",t)}},{default:L((function(){return e(n[11]||(n[11]=[j("启动")]))})),_:2},1032,["onClick"])),E(r,{type:"default",onClick:function(e){return x(pt)("restart",t)}},{default:L((function(){return e(n[13]||(n[13]=[j("重启")]))})),_:2},1032,["onClick"]),"main"!==t.sid?(_(),k(S,{key:2},[E(r,{type:"default",onClick:function(e){return x(ct)(t)}},{default:L((function(){return e(n[14]||(n[14]=[j("编辑")]))})),_:2},1032,["onClick"]),E(r,{type:"default",onClick:function(e){return x(ft)(t)}},{default:L((function(){return e(n[15]||(n[15]=[j("日志")]))})),_:2},1032,["onClick"]),E(r,{type:"default",onClick:function(e){return x(dt)(t)}},{default:L((function(){return e(n[16]||(n[16]=[j("删除")]))})),_:2},1032,["onClick"])],64)):U("v-if",!0)])])])})),128))]),E(i,{options:x(at)},null,8,["options"]),E(v,{title:"".concat(x(Z).isEdit?"编辑":"添加","服务"),modelValue:x(W),"onUpdate:modelValue":n[6]||(n[6]=function(t){return q(W)?W.value=t:null}),area:50,"show-footer":!0,onConfirm:x(vt),onCancel:x(mt)},{default:L((function(){return[C("div",Ot,[E(m,{rules:x(it),"label-width":"90px",model:x(Z),ref_key:"servicesFormRef",ref:$,disabled:x(X),size:"small",onSubmit:n[5]||(n[5]=O((function(){}),["prevent"]))},{default:L((function(){return[E(l,{label:"名称",prop:"name"},{default:L((function(){return[E(a,{modelValue:x(Z).name,"onUpdate:modelValue":n[0]||(n[0]=function(t){return x(Z).name=t}),name:"name",width:"32rem"},null,8,["modelValue"])]})),_:1}),E(l,{label:"启动命令",prop:"command"},{default:L((function(){return[E(a,{modelValue:x(Z).command,"onUpdate:modelValue":n[1]||(n[1]=function(t){return x(Z).command=t}),name:"command",width:"32rem"},null,8,["modelValue"])]})),_:1}),C("div",{class:"more flex items-center cursor-pointer pl-[10rem] my-[2rem] px-[2rem]",onClick:n[2]||(n[2]=function(t){return tt.value=!x(tt)})},[C("i",{class:A(x(tt)?"svgtofont-el-arrow-down":"svgtofont-el-arrow-right")},null,2),C("div",At,P("更多设置,".concat(x(tt)?"点击收回":"点击查看")),1)]),b(C("div",Pt,[E(l,{label:"优先级",prop:"level"},{default:L((function(){return[E(a,{modelValue:x(Z).level,"onUpdate:modelValue":n[3]||(n[3]=function(t){return x(Z).level=t}),type:"number",name:"level",width:"32rem"},null,8,["modelValue"])]})),_:1}),E(l,{label:"日志管理",prop:"log_type"},{default:L((function(){return[E(u,{modelValue:x(Z).log_type,"onUpdate:modelValue":n[4]||(n[4]=function(t){return x(Z).log_type=t}),options:x(nt),onChange:x(lt),class:"!w-32rem"},null,8,["modelValue","options","onChange"])]})),_:1})],512),[[N,x(tt)]])]})),_:1},8,["rules","model","disabled"]),b(E(i,{class:"pl-4rem",options:[{content:"【优先级】执行项目启动时,会按照优先级从高到低一次启动服务,主服务的优先级为10"}]},null,512),[[N,x(tt)]])])]})),_:1},8,["title","modelValue","onConfirm","onCancel"]),E(v,{title:"【".concat(x(ot).title,"】服务日志"),modelValue:x(rt),"onUpdate:modelValue":n[8]||(n[8]=function(t){return q(rt)?rt.value=t:null}),area:70},{default:L((function(){return[b((_(),k("div",Nt,[C("div",null,[E(r,{onClick:n[7]||(n[7]=function(t){return x(st)(!0)}),type:"default",class:"!mb-1rem"},{default:L((function(){return n[17]||(n[17]=[j("刷新日志")])})),_:1})]),E(h,{content:x(ot).logContent,isHtml:!0,class:"h-41rem","full-screen":{title:"全屏查看【".concat(x(ot).title,"】服务日志"),onRefresh:function(){return x(st)}}},null,8,["content","full-screen"])])),[[y,x(ot).logLoading]])]})),_:1},8,["title","modelValue"])])),[[y,x(et)]])}}});t("default",m(qt,[["__scopeId","data-v-6d82118e"],["__file","/Users/chudong/project/linux-10/src/views/site/views/python-model/collaborative-service/index.vue"]]))}}}))}();
Save File
Cancel